<template>
	<view class="Body">
		<div class="Main Site" style="overflow: visible;">

			<div class="PageBox">
				<div class="van-nav-bar van-nav-bar--fixed">
					<div class="van-nav-bar__content">
						<div class="van-nav-bar__left" @click="back">
							<u-icon name="arrow-left" color="#fff" size="32rpx"></u-icon>
						</div>
						<div class="van-nav-bar__title van-ellipsis" style="color: #fff;margin-left: 54rpx;">{{common.wallet.default[2]}}</div>
						<div class="van-nav-bar__right" @click="dumprun('/pages/setting/withdrawlist')"><i
								class="van-icon"><img src="../../static/image/news/task00.png"
									class="van-icon__image"></i></div>
					</div>
				</div>

				

				
				<div class="box" style="margin-top: 40rpx;">
					<view class="new-top">
						余额(EUR)
						<text>1889.25</text>
					</view>
					<view class="box-ntitle">
						{{common.withdraw[3]}}
					</view>
					<view class="box-ninput">
						<input type="text" :placeholder="common.withdraw[7]"
								 v-model="money">
					</view>
					<view class="box-ntitle" style="margin-top: 44rpx;">
						手机号码
					</view>
					<view class="box-ninput">
						<input type="text" placeholder="请输入手机号码">
					</view>
					<!-- <div class="van-cell van-field">
						<div class="van-cell__title van-field__label"><span>{{common.withdraw[3]}}</span>
						</div>
						<div class="van-cell__value van-field__value">
							<div class="van-field__body2"><input type="text" :placeholder="common.withdraw[7]"
									class="van-field__control" v-model="money"></div>
						</div>
					</div> -->
				</div>
				<div class="new-sumbit" @click="tijiao">
					{{common.recharge.default[4]}}
				</div>
			</div>
		</div>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isshow: false,
				userinfo: [],
				bank_deposit: '',
				jine: '',
				bili: '',
				moneytype: 'CHN',
				lang: 'eng',
				money: '',
				form: {
					// bank_name: '',
					// card_no: '',
					name: '',
					money: '',
					// bank_id: ''
				}
			};
		},
		onLoad(options) {
			// const {
			// 	id
			// } = options
			// this.id = id
			this.moneytype = options.moneytype || 'CHN';
			this.lang = this.$store.state.lang || 'eng';
			this.$u.api.index.shoujia().then(res => {
				this.bili = res.data.shoujia
			})

		},
		onShow() {
			this.getuserinfo()
		},
		methods: {
			// 提现
			tijiao() { 
				const token = uni.getStorageSync('token');
				this.$u.api.index.apply_withdrawal(token, this.money).then(res => {
					if(res.code == 1){
						this.$utils.showToast(res.msg)
						setTimeout(() => {
							this.back()
						}, 1000)
					}
				
				})


			},
			allin() {
				this.jine = this.userinfo.balance_revered
			},
			getuserinfo() {
				const token = uni.getStorageSync('token');
				this.$u.api.index.getUserinfo(token).then(res => {
					this.userinfo = res.data;
					if (res.data.bank.length == 0) {
						this.dumprun('/pages/setting/bindAccount')
					} else {
						// this.bank_name = res.data.bank[0].bank_name
						// this.name = res.data.bank[0].name
						// this.card_no = res.data.bank[0].card_no
						// this.bank_deposit = res.data.bank[0].bank_deposit

						this.$set(this.form, 'bank_name', res.data.bank[0].bank_name)
						this.$set(this.form, 'card_no', res.data.bank[0].card_no)
						this.$set(this.form, 'name', res.data.bank[0].name)
						// this.$set(this.form, 'bank_id', res.data.bank[0].id)

					}
				})
			},
			back() {
				const pages = getCurrentPages();
				if (pages.length === 2) {
					uni.navigateBack({
						delta: 1
					});
				} else if (pages.length === 1) {
					uni.switchTab({
						url: '/pages/index/index',
					})
				} else {
					uni.navigateBack({
						delta: 1
					});
				}
			},
			dumprun(url) {
				uni.navigateTo({
					url
				})
			},


		},
		computed: {
			common() {
				return this.$t("common")
			},
		}
	}
</script>

<style scoped lang="scss">
	.PageBox {
		color: #635327;
		padding-top: 40px;
		background-color: #2A2D34;
	}

	.van-nav-bar {
		background-color: #2A2D34 !important;
	}

	.van-nav-bar .van-nav-bar__arrow,
	.van-nav-bar .van-nav-bar__title {
		color: #222;
	}

	.PageBox .van-cell {
		background-color: #fff;
	}

	.PageBox .van-cell .van-cell__title {
		font-size: 15px;
		font-weight: 700;
		color: #ccc
	}

	.PageBox .box {
		padding: 16rpx 22rpx;
		box-sizing: border-box;
	}

	.box {
		.van-field__control {
			text-align: right;
		}

		.van-field {
			border: none;
		}

		.van-field__label {
			color: #222 !important;
		}
	}

	p {
		width: 80px
	}

	.btn {
		width: 86%;
		padding: 20px 50px;
		border-radius: 12rpx;
		background-color: #03E4DF;
		color: #000;
		font-size: 26rpx;
		text-align: center;
		margin: 15px 30px 30px
	}

	.van-field__body2 {}
	.new-top{
		width: 708rpx;
		height: 162rpx;
		background-image: url('../../static/image/my/txbj.png');
		background-size: 100% 100%;
		padding-left: 16rpx;
		padding-top: 40rpx;
		font-family: Inter, Inter;
		font-weight: 400;
		font-size: 22rpx;
		color: #000000;
		display: flex;
		flex-direction: column;
		margin-bottom: 64rpx;
		text{
			margin-top: 20rpx;
			font-family: WeChat Sans Std, WeChat Sans Std;
			font-weight: bold;
			font-size: 40rpx;
			color: #000000;
		}
	}
	.box-ntitle{
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 26rpx;
		color: #FFFFFF;
	}
	.box-ninput{
		margin-top: 20rpx;
		width: 700rpx;
		height: 100rpx;
		background: #2A2D34;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		border: 2rpx solid #6F6F6F;
		display: flex;
		align-items: center;
		padding: 0 20rpx;
		position: relative;
		input{
			font-family: PingFang SC, PingFang SC;
			font-weight: 500;
			font-size: 24rpx;
			color: #FFFFFF;
			flex: 1;
		}
		.fz-icon{
			width: 56rpx;
			height: 56rpx;
		}
		.balue-new{
			position: absolute;
			top: 12rpx;
			right: 22rpx;
			font-family: PingFang SC, PingFang SC;
			font-weight: bold;
			font-size: 24rpx;
			color: #FFFFFF;
		}
	}
	.new-sumbit{
		width: 690rpx;
		height: 88rpx;
		background: #03E4DF;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		line-height: 88rpx;
		text-align: center;
		font-family: PingFang SC, PingFang SC;
		font-weight: bold;
		font-size: 32rpx;
		color: #111111;
		margin-left: 30rpx;
		margin-top: 110rpx;
	}
</style>